A cache memory can be a type of memory that a processor can access faster than main memory. Cache memories can be used to improve performance by keeping frequently accessed data in the faster cache and avoiding the need to constantly fetch data from a slower main memory. When a processor needs to read data from main memory, it can first look in the cache to see if the data is present there.
Cache replacement policies decide what data to maintain and evict from a cache memory as a result of memory reads and writes. In general, cache replacement policies aim to maximize cache hits in order improve memory access speeds. However, this approach may be unsuitable for memory types different from those traditionally used as cache memories. In particular, this approach may decrease the lifetime of non-volatile memory.
Recent developments have raised the possibility of utilizing non-volatile memory as cache. Using non-volatile memory as cache may lead to lower power consumption and charge leakage, as well as a higher density cache. However, systems using cache memory should take into account that non-volatile memory wears out with usage, and that wear-leveling techniques can be used to maximize the lifetime of non-volatile memory. Wear-leveling techniques can attempt to spread the usage of non-volatile memory blocks evenly among all blocks.